+Thu Jul 22 01:42:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init):
+ Add a new :ellipsize property which controls ellipsization of the
+ rendered text. (#144835, Vincent Untz, patch by Jonathan Blandford
+ and Anders Carlsson
+
+ * gtk/gtkfilechooserdefault.c (create_file_list): Use ellipsization
+ for the name column.
+
Thu Jul 22 01:21:28 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkfontsel.c (gtk_font_selection_init): Add additional
* configure.in: Require Pango 1.5.1 (for ellipsisation).
* gtk/gtklabel.h:
- * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsise
- property which controls ellipsisation of the label. (#125250,
+ * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsize
+ property which controls ellipsization of the label. (#125250,
Tim Van Wassenhove, patch by James M. Cape)
- * tests/testellipsise.c: Simple test for ellipsisation.
+ * tests/testellipsise.c: Simple test for ellipsizsation.
Wed Jul 21 22:46:27 2004 Matthias Clasen <maclas@gmx.de>
+Thu Jul 22 01:42:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init):
+ Add a new :ellipsize property which controls ellipsization of the
+ rendered text. (#144835, Vincent Untz, patch by Jonathan Blandford
+ and Anders Carlsson
+
+ * gtk/gtkfilechooserdefault.c (create_file_list): Use ellipsization
+ for the name column.
+
Thu Jul 22 01:21:28 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkfontsel.c (gtk_font_selection_init): Add additional
* configure.in: Require Pango 1.5.1 (for ellipsisation).
* gtk/gtklabel.h:
- * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsise
- property which controls ellipsisation of the label. (#125250,
+ * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsize
+ property which controls ellipsization of the label. (#125250,
Tim Van Wassenhove, patch by James M. Cape)
- * tests/testellipsise.c: Simple test for ellipsisation.
+ * tests/testellipsise.c: Simple test for ellipsizsation.
Wed Jul 21 22:46:27 2004 Matthias Clasen <maclas@gmx.de>
+Thu Jul 22 01:42:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init):
+ Add a new :ellipsize property which controls ellipsization of the
+ rendered text. (#144835, Vincent Untz, patch by Jonathan Blandford
+ and Anders Carlsson
+
+ * gtk/gtkfilechooserdefault.c (create_file_list): Use ellipsization
+ for the name column.
+
Thu Jul 22 01:21:28 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkfontsel.c (gtk_font_selection_init): Add additional
* configure.in: Require Pango 1.5.1 (for ellipsisation).
* gtk/gtklabel.h:
- * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsise
- property which controls ellipsisation of the label. (#125250,
+ * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsize
+ property which controls ellipsization of the label. (#125250,
Tim Van Wassenhove, patch by James M. Cape)
- * tests/testellipsise.c: Simple test for ellipsisation.
+ * tests/testellipsise.c: Simple test for ellipsizsation.
Wed Jul 21 22:46:27 2004 Matthias Clasen <maclas@gmx.de>
+Thu Jul 22 01:42:16 2004 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_class_init):
+ Add a new :ellipsize property which controls ellipsization of the
+ rendered text. (#144835, Vincent Untz, patch by Jonathan Blandford
+ and Anders Carlsson
+
+ * gtk/gtkfilechooserdefault.c (create_file_list): Use ellipsization
+ for the name column.
+
Thu Jul 22 01:21:28 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtkfontsel.c (gtk_font_selection_init): Add additional
* configure.in: Require Pango 1.5.1 (for ellipsisation).
* gtk/gtklabel.h:
- * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsise
- property which controls ellipsisation of the label. (#125250,
+ * gtk/gtklabel.c (gtk_label_class_init): Add a new :ellipsize
+ property which controls ellipsization of the label. (#125250,
Tim Van Wassenhove, patch by James M. Cape)
- * tests/testellipsise.c: Simple test for ellipsisation.
+ * tests/testellipsise.c: Simple test for ellipsizsation.
Wed Jul 21 22:46:27 2004 Matthias Clasen <maclas@gmx.de>
PROP_UNDERLINE,
PROP_RISE,
PROP_LANGUAGE,
+ PROP_ELLIPSIZE,
/* Whether-a-style-arg-is-set args */
PROP_BACKGROUND_SET,
PROP_STRIKETHROUGH_SET,
PROP_UNDERLINE_SET,
PROP_RISE_SET,
- PROP_LANGUAGE_SET
+ PROP_LANGUAGE_SET,
+ PROP_ELLIPSIZE_SET
};
static gpointer parent_class;
guint single_paragraph : 1;
guint language_set : 1;
guint markup_set : 1;
-
+ guint ellipsize_set : 1;
+
gulong focus_out_id;
PangoLanguage *language;
-
+ PangoEllipsizeMode ellipsize;
+
gulong populate_popup_id;
gulong entry_menu_popdown_timeout;
gboolean in_entry_menu;
G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ELLIPSIZE,
+ g_param_spec_enum ("ellipsize",
+ P_("Ellipsize"),
+ P_("The preferred place to ellipsize the string, if the cell renderer does not have enough room to display the entire string, if at all"),
+ PANGO_TYPE_ELLIPSIZE_MODE,
+ PANGO_ELLIPSIZE_NONE,
+ G_PARAM_READWRITE));
+
/* Style props are set or not */
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (object_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE))
P_("Language set"),
P_("Whether this tag affects the language the text is rendered as"));
+ ADD_SET_PROP ("ellipsize_set", PROP_ELLIPSIZE_SET,
+ P_("Language set"),
+ P_("Whether this tag affects the ellipsize mode"));
+
text_cell_renderer_signals [EDITED] =
g_signal_new ("edited",
G_OBJECT_CLASS_TYPE (object_class),
g_value_set_string (value, pango_language_to_string (priv->language));
break;
+ case PROP_ELLIPSIZE:
+ g_value_set_enum (value, priv->ellipsize);
+ break;
+
case PROP_BACKGROUND_SET:
g_value_set_boolean (value, celltext->background_set);
break;
case PROP_LANGUAGE_SET:
g_value_set_boolean (value, priv->language_set);
break;
+
+ case PROP_ELLIPSIZE_SET:
+ g_value_set_boolean (value, priv->ellipsize_set);
+ break;
case PROP_BACKGROUND:
case PROP_FOREGROUND:
g_object_notify (object, "language_set");
break;
+ case PROP_ELLIPSIZE:
+ priv->ellipsize = g_value_get_enum (value);
+ priv->ellipsize_set = TRUE;
+ g_object_notify (object, "ellipsize_set");
+ break;
+
case PROP_BACKGROUND_SET:
celltext->background_set = g_value_get_boolean (value);
break;
priv->language_set = g_value_get_boolean (value);
break;
+ case PROP_ELLIPSIZE_SET:
+ priv->ellipsize_set = g_value_get_enum (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
if (celltext->rise_set)
add_attr (attr_list, pango_attr_rise_new (celltext->rise));
+
+ if (priv->ellipsize_set)
+ pango_layout_set_ellipsize (layout, priv->ellipsize);
+ else
+ pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE);
pango_layout_set_attributes (layout, attr_list);
pango_layout_set_width (layout, -1);
GtkCellRendererText *celltext = (GtkCellRendererText *) cell;
PangoRectangle rect;
PangoLayout *layout;
+ GtkCellRendererTextPrivate *priv;
+
+ priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
if (celltext->calc_fixed_height)
{
if (width == NULL)
return;
}
+
layout = get_layout (celltext, widget, FALSE, 0);
- pango_layout_get_pixel_extents (layout, NULL, &rect);
+ pango_layout_get_pixel_extents (layout, NULL, &rect);
+
if (width)
*width = GTK_CELL_RENDERER (celltext)->xpad * 2 + rect.width;
GtkStateType state;
gint x_offset;
gint y_offset;
+ GtkCellRendererTextPrivate *priv;
+
+ priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
layout = get_layout (celltext, widget, TRUE, flags);
g_object_unref (gc);
}
+ if (priv->ellipsize)
+ pango_layout_set_width (layout, cell_area->width * PANGO_SCALE);
+ else
+ pango_layout_set_width (layout, -1);
+
gtk_paint_layout (widget->style,
window,
state,
impl->list_name_column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_expand (impl->list_name_column, TRUE);
+ gtk_tree_view_column_set_resizable (impl->list_name_column, TRUE);
gtk_tree_view_column_set_title (impl->list_name_column, _("Name"));
gtk_tree_view_column_set_sort_column_id (impl->list_name_column, FILE_LIST_COL_NAME);
list_icon_data_func, impl, NULL);
impl->list_name_renderer = gtk_cell_renderer_text_new ();
+ g_object_set (impl->list_name_renderer,
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ NULL);
g_signal_connect (impl->list_name_renderer, "edited",
G_CALLBACK (renderer_edited_cb), impl);
g_signal_connect (impl->list_name_renderer, "editing-canceled",
/* Modification time column */
column = gtk_tree_view_column_new ();
+ gtk_tree_view_column_set_resizable (column, TRUE);
gtk_tree_view_column_set_title (column, _("Modified"));
renderer = gtk_cell_renderer_text_new ();